import numpy as np
import pandas as pd
from sklearn.preprocessing import LabelEncoder


def get_csv_data( file_name ,drop_col = []):
    data = pd.read_csv(file_name, delimiter=';')
    data.drop(columns=drop_col)
    return data

def to_val(data):
    struct_data = data.copy()
    non_numeric_columns = list(struct_data.select_dtypes(exclude=[np.number]).columns)
    le = LabelEncoder()
    for col in non_numeric_columns:
        struct_data[col] = le.fit_transform(struct_data[col])
    return struct_data


if __name__ == '__main__':
    data = get_csv_data('student-por.csv',['school','sex','age','Mjob', 'Fjob','reason','guardian'])
    data_val = to_val(data)